<?php
class Connection {

	public $mysql;
	
    function __construct($phost, $pdbuser, $pdbpass, $pdbname) {
	    $this->mysql = new mysqli($phost, $pdbuser, $pdbpass, $pdbname);
	    if ($this->mysql->errno) {
	    	echo "Fallo al conectar. Error: " . die(mysqli_connect_error());
		} 
    }
    function __destruct() {
    	$this->mysql->close();
    }
}
$connection=new Connection('localhost','root','root','stick_wars_bootstrap');
?>